import {
  defineConfig,
  presetAttributify,
  presetUno,
  presetWind,
  presetIcons,
  transformerAttributifyJsx,
  presetTypography
} from 'unocss'

export default defineConfig({
  // UnoCSS选项
  presets: [
    presetUno(),
    presetAttributify(),
    presetWind(),
    presetTypography(),
    presetIcons({
      // cdn: "https://esm.sh/",
      carbon: () => import('@iconify-json/carbon/icons.json').then((i) => i.default),
      mdi: () => import('@iconify-json/mdi/icons.json').then((i) => i.default),
      extraProperties: {
        display: 'inline-block',
        'vertical-align': 'middle'
      }
    })
  ],
  transformers: [transformerAttributifyJsx()],
  rules: [['text-primary', { color: '#1D6FF5' }]],
  shortcuts: [
    {
      center: 'flex items-center justify-center',
      'col-center': 'flex flex-col items-center',
      'start-center': 'flex items-center',
      'space-between-center': 'flex flex-justify-between items-center',
      // "space-between": "flex flex-justify-between",
      'align-center': 'flex flex-items-center'
    }
  ],
  content: {
    pipeline: {
      include: [
        // the default
        /\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/,
        // 这里只写我需要的，当然你也可以定制，参考：https://unocss.dev/guide/extracting#extracting-from-build-tools-pipeline
        'src/**/*.{js,ts}'
      ]
      // exclude files
      // exclude: []
    }
  }
})
// ion: () => import("@iconify-json/ion/icons.json").then((i) => i.default),
